<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>后台管理_学校管理</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <script src="/js/jquery-2.0.3.min.js" type="text/javascript"></script>
    <script src="/js/bootstrap.min.js"></script>
    <link href="/artDialog4.1.7/skins/default.css" rel="stylesheet" />
    <script src="/artDialog4.1.7/artDialog.js"></script>
    <script src="/artDialog4.1.7/plugins/iframeTools.js"></script>
    <script>
        function openPic(schoolId){
            art.dialog.open('/man/school/pictures/list?schoolId='+schoolId,
                    {title: '学校图片',width:800,height:600});
        }
        function openSpec(schoolId){
                    art.dialog.open('/man/school/specialty/list?schoolId='+schoolId,
                            {title: '学校专业',width:800,height:600});
                }
    </script>
</head>
<body>
<div class="container" >
    <div class="row">
        <div class="col-md-4"></div>
        <div class="col-md-8">
            <ul class="nav nav-pills" >
                <li class="active"><a href="#">学校管理</a> </li>
                <li><a href="/man/article/list">文章管理</a></li>
                <li><a href="/man/apply/list">报名管理</a></li>
            </ul>
        </div>
    </div>
    <p class="lead"></p>
    <div class="row">
        <div class="span4 offset7">
            <form class="form-search" action="#">
                <label>学校：</label> <input type="text" name="search_LIKE_name" class="input-medium" value="${param.search_LIKE_name}">
                <button type="submit" class="btn btn-default" id="search_btn">Search</button>
                <a class="btn btn-default" href="/man/school/add">创建学校</a>
            </form>
        </div>
    </div>
    <table id="contentTable" class="table table-striped table-bordered table-condensed">
        <thead>
        <tr><th rowspan="2">学校名称</th><th rowspan="2">招生专业</th><th rowspan="2">招生对象</th><th rowspan="2">招生层次</th><th rowspan="2">学费</th><th rowspan="2">操作</th><th colspan="2">推荐</th></tr>
        <tr><th>增加</th><th>取消</th></tr>
        </thead>
        <tbody>
        <c:forEach items="${list.content}" var="school">
            <tr>
                <td><a href="/man/school/update/${school.id}">${school.name}</a></td>
                <td>${school.specialty}</td>
                <td>${school.target}</td>
                <td>${school.levels}</td>
                <td>${school.fee}</td>
                <td><a href="/man/school/update/${school.id}">修改</a>&nbsp;&nbsp;<button class="btn btn-link" onclick="openPic(${school.id})">图片</button>&nbsp;&nbsp;<button class="btn btn-link" onclick="openSpec(${school.id})">专业</button> &nbsp;&nbsp;<a href="/man/school/delete/${school.id}">删除</a></td>
                <td><c:if test="${!school.recommend1}"><a href="/man/school/recommend?id=${school.id}&recomm=1&type=0">1</a></c:if> <c:if test="${!school.recommend2}"><a href="/man/school/recommend?id=${school.id}&recomm=2&type=0">2</a></c:if> <c:if test="${!school.recommend3}"><a href="/man/school/recommend?id=${school.id}&recomm=4&type=0">3</a></c:if></td>
                <td><c:if test="${school.recommend1}"><a href="/man/school/recommend?id=${school.id}&recomm=1&type=1">1</a></c:if> <c:if test="${school.recommend2}"><a href="/man/school/recommend?id=${school.id}&recomm=2&type=1">2</a></c:if> <c:if test="${school.recommend3}"><a href="/man/school/recommend?id=${school.id}&recomm=4&type=1">3</a></c:if></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <tags:pagination page="${list}" paginationSize="5"/>
</div>
</body>
</html>